package com.iflytek.ossp.auth.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.ForeignKey;

import com.iflytek.ossp.entity.BaseEntity;

@Entity
@Table(name="menu_info")
public class MenuInfo extends BaseEntity{
	
	public static final int MENU_TYPE_FOLDER = 1;
	public static final int MENU_TYPE_PAGE = 2;
	public static final int MENU_TYPE_ACTION = 3;
	
	private String name;
	private String link;
	private Integer menuType;
	private Integer menuOrder;
	private MenuInfo parent;
	
	@Column(length=128)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column(length=512)
	public String getLink() {
		return link;
	}
	public void setLink(String link) {
		this.link = link;
	}
	
	@Column(name="menu_type")
	public Integer getMenuType() {
		return menuType;
	}
	public void setMenuType(Integer menuType) {
		this.menuType = menuType;
	}
	@Column(name="menu_order")
	public Integer getMenuOrder() {
		return menuOrder;
	}
	public void setMenuOrder(Integer menuOrder) {
		this.menuOrder = menuOrder;
	}
	@ManyToOne
	@JoinColumn(name="parent_id")
	@ForeignKey(name="none")
	public MenuInfo getParent() {
		return parent;
	}
	public void setParent(MenuInfo parent) {
		this.parent = parent;
	}
}
